import type { AppRouteModule } from '@/router/types';

import { LAYOUT } from '@/router/constant';

const zhm: AppRouteModule = {
  path: '/zhm',
  name: 'ZHM',
  component: LAYOUT,
  redirect: '/zhm/device',
  meta: {
    orderNo: 500,
    icon: 'ion:bar-chart-outline',
    title: '张华明',
  },
  children: [
    {
      path: 'test-cross',
      name: '测试跨域',
      meta: {
        title: '测试跨域',
      },
      component: () => import('@/views/zhm/test/TestFeign.vue'),
    },
    {
      path: 'all-device',
      name: '全部设备',
      meta: {
        title: '全部设备',
      },
      component: () => import('@/views/zhm/device/AllDevice.vue'),
    },
    {
      path: 'device',
      name: '设备工具',
      meta: {
        title: '设备工具',
      },
      component: () => import('@/views/zhm/device/DeviceInfo.vue'),
    },
    {
      path: 'product_list',
      name: '产品列表',
      meta: {
        title: '产品列表',
      },
      component: () => import('@/views/zhm/product/ProductList.vue'),
    },
    {
      path: 'product_item/:productId',
      name: 'product_item',
      meta: {
        title: '产品详情',
      },
      component: () => import('@/views/zhm/product/ProductInfo.vue'),
    },
    {
      path: 'history-log',
      name: '历史日志',
      meta: {
        title: '历史日志',
      },
      component: () => import('@/views/zhm/device/HistoryLog.vue'),
    },
    {
      path: 'history-dp-data',
      name: '历史DP数据',
      meta: {
        title: '历史DP数据',
      },
      component: () => import('@/views/zhm/device/HistoryDpData.vue'),
    },
    {
      path: 'history-power-data',
      name: '历史电量数据',
      meta: {
        title: '历史电量数据',
      },
      component: () => import('@/views/zhm/device/HistoryPowerData.vue'),
    },
    {
      path: 'history-origin-data',
      name: 'historyOriginData',
      meta: {
        title: '原始日志',
      },
      component: () => import('@/views/zhm/device/HistoryOriginData.vue'),
    },
    {
      path: 'virtual-device',
      name: 'virtualDevice',
      meta: {
        title: '虚拟设备',
      },
      children: [
        {
          path: 'add-device',
          name: 'addVirtualDevice',
          component: () => import('@/views/zhm/virtual-device/AddDevice.vue'),
          meta: {
            title: '添加虚拟设备',
          },
        },
        {
          path: 'device-list',
          name: 'virtualDeviceList',
          component: () => import('@/views/zhm/virtual-device/DeviceList.vue'),
          meta: {
            title: '虚拟设备列表',
          },
        },
        {
          path: 'device/:sn',
          name: 'virtualDeviceTool',
          component: () => import('@/views/zhm/virtual-device/DeviceTool.vue'),
          meta: {
            title: '虚拟设备工具',
            hideMenu: true,
          },
        },
      ],
    },
    {
      path: 'ws',
      name: 'ws',
      meta: {
        title: 'ws',
      },
      children: [
        {
          path: 'simple-ws',
          name: 'SimpleWs',
          component: () => import('@/views/zhm/ws/index.vue'),
          meta: {
            title: '简单ws',
          },
        },
        {
          path: 'iot-origin-data-ws',
          name: 'IotOriginData',
          component: () => import('@/views/zhm/ws/IotOriginData.vue'),
          meta: {
            title: '原始数据',
          },
        },
        {
          path: 'realtime-log-ws',
          name: 'RealtimeLog',
          component: () => import('@/views/zhm/ws/RealtimeLog.vue'),
          meta: {
            title: '实时日志',
          },
        },
      ],
    },
    {
      path: 'baidu',
      name: 'baidu',
      meta: {
        title: 'baidu',
      },
      component: () => import('@/views/zhm/Baidu.vue'),
    },
    {
      path: 'token',
      name: 'token',
      meta: {
        title: 'token',
      },
      component: () => import('@/views/zhm/Token.vue'),
    },
    {
      path: 'json-edit',
      name: 'JsonEdit',
      meta: {
        title: 'JsonEdit',
      },
      component: () => import('@/views/zhm/JsonEdit.vue'),
    },
    {
      path: 'my-flow',
      name: 'MyFlow',
      meta: {
        title: 'MyFlow',
      },
      component: () => import('@/views/zhm/MyFlow.vue'),
    },
    {
      path: 'zhm-react/',
      name: 'mircoApp',
      meta: {
        title: 'mircoApp',
      },
      component: () => import('@/views/zhm/ZhmMicroApp.vue'),
    },
  ],
};

export default zhm;
